package reflectCus;

import java.lang.reflect.Constructor;
import java.lang.reflect.InvocationTargetException;

//反射---获取构造器实例化
public class ReflectDemo3 {
    public static void main(String[] args) throws NoSuchMethodException, InvocationTargetException, InstantiationException, IllegalAccessException {
            Class cls=Person.class;
          Constructor c =  cls.getConstructor(String.class,int.class);
         Object o= c.newInstance("秒钟女士",45);
        System.out.println(o);
    }
}
